package com.ruoyi.web.studentmanagementsystem.service.impl;

import com.ruoyi.web.studentmanagementsystem.service.ISysCodeService;
import com.ruoyi.web.studentmanagementsystem.tool.Captcha;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * ClassName: SysCodeServiceImpl
 * Package: com.ruoyi.web.studentmanagementsystem.service.impl
 * Description:验证码 服务实现
 *
 * @Author Mr. o
 * @Create 2023/11/16 20:10
 * @Version 1.0
 */
@Service
public class SysCodeServiceImpl implements ISysCodeService {

    @Resource
    private Captcha captcha;

    @Override
    @Transactional
    public void updateCode() {
        captcha.updateCode();
    }

    @Override
    @Transactional
    public String outPutCode() {
      return captcha.getCode();
    }

    @Override
    @Transactional
    public String inPutCode(String select) {
        return captcha.selectCode(select);
    }

    @Override
    @Transactional
    public String stateLogOn() {
        return captcha.idSelect();
    }
}
